<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>凉山州中考志愿填报系统(学生端)</title>
<link rel="stylesheet" href="css/newStyle.css"
	th:href="@{/css/newStyle.css}">
<link rel="stylesheet" type="text/css" href="css/bwyStyle.css"
	th:href="@{/css/bwyStyle.css}" />
<link rel="stylesheet" type="text/css" href="css/bwy_newStyle.css"
	th:href="@{/css/bwy_newStyle.css}" />
</head>
<style>
.choceMajor {
	margin-top: 20px;
}
</style>
<body>
	<div class="mainBox">
		<div class="mainBox_inner student_inner">
			<h1>凉山州中职招生志愿填报系统(学生端)</h1>
			<p class="tips" style="text-align: center;">
				本批次填报时间限制为：2019年6月15日17：00</p>
			<p class="tips" style="text-align: center;">填报完毕后，请注意提交！</p>
			<div>
				<div class="clearfix studentInfo_header">
					<p id="xm" class="fl" th:text="'姓名： ' + ${student.xm} ">姓名：小小的雨滴</p>
					<p id="bmh" class="fl" th:text="'报名号： ' + ${student.bmh} ">报名号：25555522522</p>
					<form id="form1" th:action="loginOut"  method="post">
					<div class="fr">
						<!--修改密码 跳页面,修改密码的class="loginOut"是为了样式和安全退出一样-->
						<input type="button" class="loginOut"  onclick="javascript:history.go(-1);" value="返回上级">
                        <button id="updataPassword" class="loginOut" onclick="is_submit(1)">修改密码</button>
                     	<button id="loginOut" class="loginOut" onclick="is_submit(2)">安全退出</button>
					</div>
					</form>
				</div>
				<div class="studentInfo_body">
					<form id="ami_form" action="wish" th:action="@{/wish}"
						th:object="${wishAll}" method="post">
						<div class="four_ami" th:object="${middleSchoolWish}">
							<h3>第五批次志愿（中高职五年贯通定向试点顺序志愿）</h3>
							
							<span class="checkrepeat41">不允许有相同的学校。</span>
							
							<div class="pxzyBox">
								<div class="vol_a">
									<p>第一志愿</p>
									<select id="four1" name="xx4a"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
									
										<option
											th:if="${middleSchoolWish == null or middleSchoolWish.zzy11 == null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:value="${school4.xxdm}" th:text="${school4.xxmc}"></option>
										<option
											th:if="${middleSchoolWish != null and middleSchoolWish.zzy11 != null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:value="${school4.xxdm}" th:text="${school4.xxmc}"
											th:selected="(${middleSchoolWish.zzy11==school4.xxdm})"></option>
										<!--<option value="1000" style="display: none;">不可用</option>-->
									</select> 
									<select id="fourZY1" name="zy4a" class="choceMajor">
										<option value="">--选择专业--</option>
										
										<option
											th:if="${middleSchoolwish==null or middleSchoolWish.zzy11z1 == null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:value="${school4.zydh}" th:text="${school4.zymc}"></option>
										<option th:if="${middleSchoolWish.zzy11z1 != null}" th:each="school4:${wishAll.wishFour.zzList}" 
                                                th:value="${school4.zydh}" th:text="${school4.zymc}" th:selected="selected"></option>
                                       
										<option th:if="${middleSchoolWish.zzy11z1 != null}"
											th:value="${middleSchoolWish.zzy11z1dm}"
											th:text="${middleSchoolWish.zzy11z1}" th:selected="selected">专业1</option>
											
										
											
									</select>
									<p class="tiaopei">
										<input id="tp4a" name="zytp" type="checkbox" th:checked="${middleSchoolWish.zzy11t}">是否服从专业调配
									</p>
								</div>
								<div class="vol_a">
									<p>第二志愿</p>
									<select id="four2" name="xx4b"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
										
										<option th:if="${middleSchoolWish == null or middleSchoolWish.zzy12 == null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:value="${school4.xxdm}" th:text="${school4.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:selected="(${middleSchoolWish.zzy12==school4.xxdm})"
											th:value="${school4.xxdm}" th:text="${school4.xxmc}"></option>
										<!--<option value="1001" style="display: none;">不可用</option>-->
									</select> 
									<select id="fourZY2" name="zy4b" class="choceMajor">
										<option value="">--选择专业--</option>
									
										<option th:if="${middleSchoolWish == null or middleSchoolWish.zzy12z1 == null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:value="${school4.zydh}" th:text="${school4.zymc}"></option>
										<option th:if="${middleSchoolWish.zzy12z1 != null}"
											th:value="${middleSchoolWish.zzy12z1dm}"
											th:text="${middleSchoolWish.zzy12z1}" th:selected="selected">专业1</option>
									</select>
									<p class="tiaopei">
										<input id="tp4b" name="zytp" type="checkbox" th:checked="${middleSchoolWish.zzy12t}">是否服从专业调配
									</p>
								</div>
								<div class="vol_a">
									<p>第三志愿</p>
									<select id="four3" name="xx4c"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
								
										<option th:if="${middleSchoolWish == null or middleSchoolWish.zzy13 == null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:value="${school4.xxdm}" th:text="${school4.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:selected="(${middleSchoolWish.zzy13==school4.xxdm})"
											th:value="${school4.xxdm}" th:text="${school4.xxmc}"></option>
										<!--<option value="1001" style="display: none;">不可用</option>-->
									</select> 
									<select id="fourZY3" name="zy4c" class="choceMajor">
										<option value="">--选择专业--</option>
											<option th:if="${middleSchoolWish == null or middleSchoolWish.zzy13z1 == null}"
											th:each="school4:${wishAll.wishFour.zzList}"
											th:value="${school4.zydh}" th:text="${school4.zymc}"></option>
										<option th:if="${middleSchoolWish.zzy13z1 != null}"
											th:value="${middleSchoolWish.zzy13z1dm}"
											th:text="${middleSchoolWish.zzy13z1}" th:selected="selected">专业1</option>
									</select>
									<p class="tiaopei">
										<input id="tp4c" name="zytp" type="checkbox" th:checked="${middleSchoolWish.zzy13t}">是否服从专业调配
									</p>
								</div>

							</div>

						</div>
						<div class="fifth_ami">
							<h3>第六批次志愿（五年制“3+2”高职）</h3>

							<span class="checkrepeat51">不允许有相同的学校。</span>

							<div class="pxzyBox">
								<div class="vol_a">
									<p>志愿A（师范类）</p>
									<select id="fifth1" name="xx5a"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.normalList}"
											th:value="${school5.xxdm}" th:text="${school5.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.normalList}"
											th:selected="(${middleSchoolWish.zzy21==school5.xxdm})"
											th:value="${school5.xxdm}" th:text="${school5.xxmc}"></option>
										<!-- <option value="1000" style="display: none;">不可用</option> -->
									</select> 
									<select id="fifthZY1" name="zy5a" class="choceMajor">
										<option value="">--选择专业--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.normalList}"
											th:value="${school5.zydh}" th:text="${school5.zymc}"></option>
										<option th:if="${middleSchoolWish.zzy21z1 != null}"
											th:value="${middleSchoolWish.zzy21z1dm}"
											th:text="${middleSchoolWish.zzy21z1}" th:selected="selected">专业1</option>
									</select>
									<p class="tiaopei">
										<input id="tp5a" name="zytp" type="checkbox" th:checked="${middleSchoolWish.zzy21t}">是否服从专业调配
									</p>

								</div>
								<div class="vol_a">
									<p>志愿B（师范类）</p>
									<select id="fifth2" name="xx5b"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.normalList}"
											th:value="${school5.xxdm}" th:text="${school5.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.normalList}"
											th:selected="(${middleSchoolWish.zzy22==school5.xxdm})"
											th:value="${school5.xxdm}" th:text="${school5.xxmc}"></option>
										<!-- <option value="1001" style="display: none;">不可用</option> -->
									</select> 
									<select id="fifthZY2" name="zy5b" class="choceMajor">
										<option value="">--选择专业--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.normalList}"
											th:value="${school5.zydh}" th:text="${school5.zymc}"></option>
										<option th:if="${middleSchoolWish.zzy22z1 != null}"
											th:value="${middleSchoolWish.zzy22z1dm}"
											th:text="${middleSchoolWish.zzy22z1}" th:selected="selected">专业1</option>
									</select>
									<p class="tiaopei">
										<input id="tp5b" name="zytp" type="checkbox" th:checked="${middleSchoolWish.zzy22t}">是否服从专业调配
									</p>

								</div>
								<div class="vol_a">
									<p>志愿C（非师范类）</p>
									<select id="fifth3" name="xx5c"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.notNormalList}"
											th:value="${school5.xxdm}" th:text="${school5.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.notNormalList}"
											th:selected="(${middleSchoolWish.zzy23==school5.xxdm})"
											th:value="${school5.xxdm}" th:text="${school5.xxmc}"></option>
										<!-- <option value="1002" style="display: none;">不可用</option> -->
									</select> 
									<select id="fifthZY3" name="zy5c" class="choceMajor">
										<option value="">--选择专业--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.notNormalList}"
											th:value="${school5.zydh}" th:text="${school5.zymc}"></option>
										<option th:if="${middleSchoolWish.zzy23z1 != null}"
											th:value="${middleSchoolWish.zzy23z1dm}"
											th:text="${middleSchoolWish.zzy23z1}" th:selected="selected">专业1</option>
									</select>
									<p class="tiaopei">
										<input id="tp5c" name="zytp" type="checkbox"  th:checked="${middleSchoolWish.zzy23t}">是否服从专业调配
									</p>

								</div>
								<div class="vol_a">
									<p>志愿D（非师范类）</p>
									<select id="fifth4" name="xx5d"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.notNormalList}"
											th:value="${school5.xxdm}" th:text="${school5.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.notNormalList}"
											th:selected="(${middleSchoolWish.zzy24==school5.xxdm})"
											th:value="${school5.xxdm}" th:text="${school5.xxmc}"></option>
										<!-- <option value="1003" style="display: none;">不可用</option> -->
									</select> 
									<select id="fifthZY4" name="zy5d" class="choceMajor">
										<option value="">--选择专业--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${middleSchoolWish == null}"
											th:each="school5:${wishAll.wishFive.notNormalList}"
											th:value="${school5.zydh}" th:text="${school5.zymc}"></option>
										<option th:if="${middleSchoolWish.zzy24z1 != null}"
											th:value="${middleSchoolWish.zzy24z1dm}"
											th:text="${middleSchoolWish.zzy24z1}" th:selected="selected">专业1</option>
									</select>
									<p class="tiaopei">
										<input id="tp5d" name="zytp" type="checkbox" th:checked="${middleSchoolWish.zzy24t}">是否服从专业调配
									</p>

								</div>
							</div>

						</div>
<div class="sixth_ami">
							<h3>第七批次志愿（职高、普通中专、成人中专、技工学校）</h3>

							<span class="checkrepeat61">不允许有相同的学校。</span>

							<div class="pxzyBox">
								<div class="vol_a">
									<p>志愿A</p>
									<select id="sixth1" name="xx6a"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>

										<option th:if="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:value="${school6.xxdm}" th:text="${school6.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:selected="(${middleSchoolWish.pzy31==school6.xxdm})"
											th:value="${school6.xxdm}" th:text="${school6.xxmc}"></option>
										<option value="1000" style="display: none;">不可用</option>
									</select> 
									<select id="sixthZY1" name="zy6a" class="choceMajor">
										<option value="">--选择专业--</option>

										<option
											th:if="${middleSchoolwish==null or middleSchoolWish.pzy31z1 == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:value="${school6.zydh}" th:text="${school6.zymc}">--选择专业--</option>
										<option th:if="${middleSchoolWish.pzy31z1 != null}"
											th:value="${middleSchoolWish.pzy31z1dm}"
											th:text="${middleSchoolWish.pzy31z1}" th:selected="selected">专业1</option>
											
									</select>
									<p class="tiaopei">
										<input id="tp6a" name="zytp" type="checkbox" th:checked="${middleSchoolWish.pzy31zt}">是否服从专业调配
									</p>

								</div>
								<div class="vol_a">
									<p>志愿B</p>
									<select id="sixth2" name="xx6b"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
										<option th:if="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:value="${school6.xxdm}" th:text="${school6.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:selected="(${middleSchoolWish.pzy32==school6.xxdm})"
											th:value="${school6.xxdm}" th:text="${school6.xxmc}"></option>
										<option value="1001" style="display: none;">不可用</option>
									</select> 
									<select id="sixthZY2" name="zy6b" class="choceMajor">
										<option value="">--选择专业--</option>
										<option th:if="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:value="${school6.zydh}" th:text="${school6.zymc}"></option>
										<option th:if="${middleSchoolWish.pzy32z1 != null}"
											th:value="${middleSchoolWish.pzy32z1dm}"
											th:text="${middleSchoolWish.pzy32z1}" th:selected="selected">
											专业1</option>

									</select>
									<p class="tiaopei">
										<input id="tp6b" name="zytp" type="checkbox" th:checked="${middleSchoolWish.pzy32zt}">是否服从专业调配
									</p>

								</div>
								<div class="vol_a">
									<p>志愿C</p>
									<select id="sixth3" name="xx6c"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>
										<option th:if="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:value="${school6.xxdm}" th:text="${school6.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:selected="(${middleSchoolWish.pzy33==school6.xxdm})"
											th:value="${school6.xxdm}" th:text="${school6.xxmc}"></option>
										<option value="1002" style="display: none;">不可用</option>
									</select> 
									<select id="sixthZY3" name="zy6c" class="choceMajor">
										<option value="">--选择专业--</option>
										<option th:if="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:value="${school6.zydh}" th:text="${school6.zymc}"></option>
										<option th:if="${middleSchoolWish.pzy33z1 != null}"
											th:value="${middleSchoolWish.pzy33z1dm}"
											th:text="${middleSchoolWish.pzy33z1}" th:selected="selected">
											专业1</option>

									</select>
									<p class="tiaopei">
										<input id="tp6c" name="zytp" type="checkbox" th:checked="${middleSchoolWish.pzy33t}" >是否服从专业调配
									</p>

								</div>
								<div class="vol_a">
									<p>志愿D</p>
									<select id="sixth4" name="xx6d"
										class="zhiyuan choceSchool1 choceSchool csd">
										<option value="">--选择学校--</option>

										<option th:if="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:value="${school6.xxdm}" th:text="${school6.xxmc}"></option>
										<option th:unless="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:selected="(${middleSchoolWish.pzy34==school6.xxdm})"
											th:value="${school6.xxdm}" th:text="${school6.xxmc}"></option>
										<option value="1003" style="display: none;">不可用</option>
									</select> 
									<select id="sixthZY4" name="zy6d" class="choceMajor">
										<option value="">--选择专业--</option>

										<option th:if="${middleSchoolWish == null}"
											th:each="school6:${wishAll.wishSix.threeYearList}"
											th:value="${school6.zydh}" th:text="${school6.zymc}"></option>
										<option th:if="${middleSchoolWish.pzy34z1 != null}"
											th:value="${middleSchoolWish.pzy34z1dm}"
											th:text="${middleSchoolWish.pzy34z1}" th:selected="selected">
											专业1</option>

									</select>
									<p class="tiaopei">
										<input id="tp6d" name="zytp" type="checkbox" th:checked="${middleSchoolWish.pzy34t}">是否服从专业调配
									</p>

								</div>
							</div>

						</div>
						<div>
							<button type="button" id="uploadInfo" class="btnclass">提交</button>
						</div>
					</form>

				</div>
			</div>
		</div>
	</div>
</body>
<script src="js/jquery-1.12.3.js"></script>
<script src="js/gVerify.js"></script>
<script src="js/commen.js"></script>
<script>
	/*中间部分为布文玉添加*/

	var size_option = $("#four1 option").size(); //获取可选学校有几个
	var size_select = $(".four_ami .zhiyuan").size(); //获取有几个select
	var num_cha = size_option - size_select //算出差值
	var num_cha1 = size_select - size_option //算出差值
	console.log(num_cha);
	//		console.log(size_select);
	//		console.log(size_option);
	if (num_cha < 2) {
		for (var i = size_option - 2; i < size_select; i++) {
			//给后面的select标签添加disabled属性，我现在怎么找到select标签呢
			/* $(".four_ami .zhiyuan").eq(i).addClass("d"); */
			$(".four_ami .zhiyuan").eq(i).attr("disabled", "disabled");
			$(".four_ami .zhiyuan").eq(i).val(i + 1000);
		}

	}
	//可填写志愿数和可选学校数一样
	var size_option_five = $("#fifth1 option").size(); //获取可选学校有几个
	var size_select_five = $(".first_ami .zhiyuan").size(); //获取有几个select
	var num_cha_five = size_option_five - size_select_five //算出差值
	var num_cha1_five = size_select_five - size_option_five //算出差值
	console.log(num_cha_five);
	//		console.log(size_select);
	//		console.log(size_option);
	if (num_cha_five < 2) {
		for (var i = size_option_five - 2; i < size_select_five; i++) {
			//给后面的select标签添加disabled属性，我现在怎么找到select标签呢

			/* $(".fifth_ami .zhiyuan").eq(i).addClass("d"); */
			$(".fifth_ami .zhiyuan").eq(i).attr("disabled", "disabled");
			$(".fifth_ami .zhiyuan").eq(i).val(i + 1000);
		}

	}
	//可填写志愿数和可选学校数一样
	var size_option_six = $("#sixth1 option").size(); //获取可选学校有几个
	var size_select_six = $(".sixth_ami .zhiyuan").size(); //获取有几个select
	var num_cha_six = size_option_six - size_select_six //算出差值
	var num_cha1_six = size_select_six - size_option_six //算出差值
	console.log(num_cha_six);
	//		console.log(size_select);
	//		console.log(size_option);
	if (num_cha_six < 2) {
		for (var i = size_option_six - 2; i < size_select_six; i++) {
			//给后面的select标签添加disabled属性，我现在怎么找到select标签呢

			/* $(".sixth_ami .zhiyuan").eq(i).addClass("d"); */
			$(".sixth_ami .zhiyuan").eq(i).attr("disabled", "disabled");
			$(".sixth_ami .zhiyuan").eq(i).val(i + 1000);
		}
	}

	//如果学校是不可选的，则专业也不可选
	$(".choceSchool").each(function() {
		if ($(this).val() >= '1000') {
			/* $(this).siblings(".choceMajor").addClass("d"); */
			$(this).siblings(".choceMajor").attr("disabled", "disabled");
		}
	})

		
    function is_submit(value) {
        var form1 = $("#quit");
        if (value == 1) {          
            var id = $("#id").val();
            form1.action = "goChangePasswd";
             $("#form1").attr("action",form1.action);
            form1.submit();
        }
        if (value == 2) {
            form1.action = "loginOut";
            $("#form1").attr("action", form1.action);
            form1.submit();

        }
    }
	
	/*//由上面的代码代替
	$('#loginOut').on('click',function(){
		var form = document.getElementById('quit');
		//再次修改input内容
		form.submit();
	})
	*/
	

	//点击提交时，判断是否可以提交
	$('#uploadInfo').on(
			'click',
			function() {
				/*选择学校后，必须选择一个专业*/
				var count;
				var check=true;
				$(".choceSchool").each(
						function() {
							/* console.log("学校id=" + $(this).val()); */
							var _this = this;
							var xxid=$(this).val();
							var zyid=$(_this).siblings("select.choceMajor").val();							
							console.log("专业id="+ zyid);
							if ((xxid !=null && xxid != "") && (zyid == null || zyid == "")) {
								alert("选择学校后至少选择一个专业！");check=false;
							} else if ( (zyid != null && zyid != "") && (xxid == null || xxid == "")) {
								alert("选择专业后必须选择一个学校！");
								check=false;
							} 
						})
						if (!check)
							{
							return false ;
							}
						
						count = 0;
						$(".choceSchool").each(function() {
     						if ($(this).val() != "" && $(this).val() != null) {
										count += 1;
									}
								})
			if(count <1) {
							alert("未填志愿不能保存！！");
							return false;
						} 
				{
					/* 	alert("准备提交数据"); */
					$.ajax({
						type : "post",
						url : "saveMiddleSchoolWish",//提交的地址
						//data:$("#ami_form").serialize(),
						data : {
							//"xm"      :$("#xm").text(),
							//"bmh"     :$("#bmh").text(),
							"zzy11" : $("#four1 option:selected").val(),
							"zzy11mc" : $("#four1 option:selected").text(),//
							"zzy11z1dm" : $("#fourZY1 option:selected").val(),//
							"zzy11z1" : $("#fourZY1 option:selected").text(),
							"zzy11t" : $("#tp4a").is(":checked"),  //如果被选中，则是true，反之是false
							"zzy12" : $("#four2 option:selected").val(),
							"zzy12mc" : $("#four2 option:selected").text(),//
							"zzy12z1dm" : $("#fourZY2 option:selected").val(),//
							"zzy12z1" : $("#fourZY2 option:selected").text(),
							"zzy12t" : $("#tp4b").is(":checked"),//如果被选中，则是true，反之是false
							"zzy13" : $("#four3 option:selected").val(),
							"zzy13mc" : $("#four3 option:selected").text(),//
							"zzy13z1dm" : $("#fourZY3 option:selected").val(),//
							"zzy13z1" : $("#fourZY3 option:selected").text(),
							"zzy13t" : $("#tp4c").is(":checked"),//如果被选中，则是true，反之是false							
							"zzy21" : $("#fifth1 option:selected").val(),
							"zzy21mc" : $("#fifth1 option:selected").text(),//
							"zzy21z1dm" : $("#fifthZY1 option:selected").val(),
							"zzy21z1" : $("#fifthZY1 option:selected").text(),
							"zzy21t" : $("#tp5a").is(":checked"),//如果被选中，则是true，反之是false
							"zzy22" : $("#fifth2 option:selected").val(),
							"zzy22mc" : $("#fifth2 option:selected").text(),//
							"zzy22z1dm" : $("#fifthZY2 option:selected").val(),//
							"zzy22z1" : $("#fifthZY2 option:selected").text(),
							"zzy22t" : $("#tp5b").is(":checked"),//如果被选中，则是true，反之是false
							"zzy23" : $("#fifth3 option:selected").val(),
							"zzy23mc" : $("#fifth3 option:selected").text(),//
							"zzy23z1dm" : $("#fifthZY3 option:selected").val(),//
							"zzy23z1" : $("#fifthZY3 option:selected").text(),
							"zzy23t" : $("#tp5c").is(":checked"),//如果被选中，则是true，反之是false
							"zzy24" : $("#fifth4 option:selected").val(),
							"zzy24mc" : $("#fifth4 option:selected").text(),//
							"zzy24z1dm" : $("#fifthZY4 option:selected").val(),
							"zzy24z1" : $("#fifthZY4 option:selected").text(),
							"zzy24t" : $("#tp5d").is(":checked"),//如果被选中，则是true，反之是false
							"pzy31" : $("#sixth1 option:selected").val(),
							"pzy31mc" : $("#sixth1 option:selected").text(),//
							"pzy31z1dm" : $("#sixthZY1 option:selected").val(),
							"pzy31z1" : $("#sixthZY1 option:selected").text(),
							"pzy31zt" : $("#tp6a").is(":checked"),//如果被选中，则是true，反之是false
							"pzy32" : $("#sixth2 option:selected").val(),
							"pzy32mc" : $("#sixth2 option:selected").text(),//
							"pzy32z1dm" : $("#sixthZY2 option:selected").val(),//
							"pzy32z1" : $("#sixthZY2 option:selected").text(),
							"pzy32zt" : $("#tp6b").is(":checked"),//如果被选中，则是true，反之是false
							"pzy33" : $("#sixth3 option:selected").val(),
							"pzy33mc" : $("#sixth3 option:selected").text(),//
							"pzy33z1dm" : $("#sixthZY3 option:selected").val(),//
							"pzy33z1" : $("#sixthZY3 option:selected").text(),
							"pzy33t" : $("#tp6c").is(":checked"),//如果被选中，则是true，反之是false
							"pzy34" : $("#sixth4 option:selected").val(),
							"pzy34mc" : $("#sixth4 option:selected").text(),//
							"pzy34z1dm" : $("#sixthZY4 option:selected").val(),//
							"pzy34z1" : $("#sixthZY4 option:selected").text(),
							"pzy34t" : $("#tp6d").is(":checked")//如果被选中，则是true，反之是false
						},
						dataType : "json",
						beforeSend : function(xhr) {
							$('#uploadInfo').attr("disabled", true);
						},
						success : function(data) {
							//alert("保存成功！");

							if (data.code == 'ok') {
								alert(data.message);
								window.location.href = data.url;
							} else if (data.code == 'error') {
								alert(data.message);
								window.location.href = data.url;
							} else {
								alert(data.message);
							}

						},
						error : function(error) {
							console.log(error);
							alert("保存失败");
						},
						complete : function(sd) {
							$('#uploadInfo').attr("disabled", false);
						}
					})
				}

				//			//判断是否含有填报不正确的内容，是否含有重复的学校
				///			if($("span").is(".checkrepeat")) {
				//				alert("有填报不正确内容！");
				//			} else {
				//				$.ajax({
				//					type: 'post',
				//					url: 'test.php',
				//					data: $("#ami_form").serialize(), //获取表单数据，select的name属性你自己加一下吧
				//					dataType: "json",
				//					success: function(data) {
				//						console.log(data);
				//						/*返回成功后执行  */
				//						$('#ami_form').find('select').attr('disabled', true); //禁用
				//					}
				//				})
				//			}

			})

	$("#four1").on('click',function() {
						$("#four1 option").each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#four1 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#four1 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										})
					});
	$("#four2")
			.on(
					'click',
					function() {
						$("#four2 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#four2 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#four2 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										})
					})

	$("#four3")
			.on(
					'click',
					function() {
						$("#four3 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#four3 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#four3 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										})
					})				
					
					
	$("#fifth1")
			.on(
					'click',
					function() {
						$("#fifth1 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#fifth1 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#fifth1 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										});
					});
	$("#fifth2")
			.on(
					'click',
					function() {
						$("#fifth2 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#fifth2 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#fifth2 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										});
					});
	$("#fifth3")
			.on(
					'click',
					function() {
						$("#fifth3 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#fifth3 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#fifth3 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										});
					})
	$("#fifth4")
			.on(
					'click',
					function() {
						$("#fifth4 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#fifth4 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#fifth4 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										});
					});
	$("#sixth1")
			.on(
					'click',
					function() {
						$("#sixth1 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#sixth1 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#sixth1 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										});
					})
	$("#sixth2")
			.on(
					'click',
					function() {
						$("#sixth2 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#sixth2 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#sixth2 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										});
					});
	$("#sixth3")
			.on(
					'click',
					function() {
						$("#sixth3 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#sixth3 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#sixth3 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										});
					});
	$("#sixth4")
			.on(
					'click',
					function() {
						$("#sixth4 option")
								.each(
										function() { /*过滤指定select中重复的学校名 */
											var getText = $(this).text();
											if ($("#sixth4 option:contains("
													+ getText + ")").length > 1) /*select option:contains("+text+")")包含text的个数 */{
												$(
														"#sixth4 option:contains("
																+ getText
																+ "):gt(0)")
														.remove(); /*包含text大于个数0的选项就移除*/
											}
										});
					});

	/*第四、五、六批志愿A/B/C/D里面的学校不能重复*/
	$(".four_ami").on(
			"change",
			"select",
			function() {
				var four1 = $("#four1").val();
				var four2 = $("#four2").val();
				console.log(four1 + ";" + four2);
				if (four1 != "" && four2 != "") {
					if (four1 == four2) {
						$(".checkrepeat41").removeClass("checkrepeat41")
								.addClass("checkrepeat4");
					} else {
						$(".checkrepeat4").removeClass("checkrepeat4").addClass(
								"checkrepeat41");
					}
				}
			})
	$(".sixth_ami").on(
			"change",
			"select",
			function() {
				var sixth1 = $("#sixth1").val();
				var sixth2 = $("#sixth2").val();
				var sixth3 = $("#sixth3").val();
				var sixth4 = $("#sixth4").val();
				if (sixth1 != "" && sixth2 != "" && sixth3 != ""
						&& sixth4 != "") {
					if (sixth1 == sixth2 || sixth1 == sixth3
							|| sixth1 == sixth4 || sixth2 == sixth3
							|| sixth4 == sixth2 || sixth3 == sixth4) {
						$(".checkrepeat61").removeClass("checkrepeat61")
								.addClass("checkrepeat6");
					} else {
						$(".checkrepeat6").removeClass("checkrepeat6").addClass(
								"checkrepeat61");
					}
				}
			})
	$(".fifth_ami").on(
			"change",
			"select",
			function() {
				var fifth1 = $("#fifth1").val();
				var fifth2 = $("#fifth2").val();
				var fifth3 = $("#fifth3").val();
				var fifth4 = $("#fifth4").val();
				if (fifth1 != "" && fifth2 != "" && fifth3 != ""
						&& fifth4 != "") {
					if (fifth1 == fifth2 || fifth1 == fifth3
							|| fifth1 == fifth4 || fifth2 == fifth3
							|| fifth4 == fifth2 || fifth3 == fifth4) {
						$(".checkrepeat51").removeClass("checkrepeat51")
								.addClass("checkrepeat5");
					} else {
						$(".checkrepeat5").removeClass("checkrepeat5").addClass(
								"checkrepeat51");
					}
				}
			})

	/*中间部分为布文玉添加*/

	//点击编辑资料去掉disabled属性
	$('.updataInfo').on('click', function() {
		$('#ami_form').find('select').removeAttr('disabled')
	})

	/*2018-5-16 PY 加*/
	//首次进入获取学校
	var optionstr = '<option value="">--选择学校--</option>';
	var choceschool = $('.choceSchool');
	$.ajax({
		type : 'post',
		//url : "wishFourFiveSixSignUp?schoolId=" + $("#four1").val(),//学校数据  four1
		url : "wishFourFiveSixSignUp",
		dataType : 'json',
		success : function(data) {
			console.log(data);

			for (var i = 0, j = data.length; i < j; i++) {
				optionstr += '<option value="'+data[i].id+'">' + data[i].name
						+ '</option>'
			}
			$(".choceSchool").html(optionstr);
		}
	})

	//点击select改变后
	choceschool.on('change', function() {
		var _this = this;
		var thisId = $(_this).val();
		var thissibling = $(_this).siblings('select.choceMajor');
		var majorstr = '<option value="">--选择专业--</option>'
		thissibling.text("")
		var values = $(_this).find("option:selected").val();

		// add by chenyj 2018/05/20 23:58 根据点击的select控件确定访问哪个URL获取专业信息  begin
		var select_id = _this.id;
		var post_url = "";
		if (select_id == "four1" || select_id == "four2" || select_id == "four3") {
			post_url = "goGetNinePlusFiveMajor" + "?schoolId=" + values;
		} else if (select_id == "fifth1" || select_id == "fifth2"){post_url = "goGetFiveYearPlanNormalMajor" + "?schoolId=" + values;}
		else if( select_id == "fifth3" || select_id == "fifth4") {post_url = "goGetFiveYearPlanNotNormalMajor" + "?schoolId=" + values;
		} else if (select_id == "sixth1" || select_id == "sixth2"
				|| select_id == "sixth3" || select_id == "sixth4") {
			post_url = "goGetThreeYearPlanMajor" + "?schoolId=" + values;
		} else {
			post_url = "check";
		}
		//add by chenyj 2018/05/20 23:58 根据点击的select控件确定访问哪个URL获取专业信息  end
		$.ajax({
			type : 'post',
			url : post_url,
			dataType : 'json',
			success : function(data) {
				console.info(data);
				//级联获取专业
				for (var i = 0, j = data.length; i < j; i++) {
					var thisdata = data[i];
					majorstr += '<option value="'+thisdata.zydh+'">'
							+ thisdata.zymc + '</option>';
				}
				$(majorstr).appendTo(thissibling);
				thissibling.removeAttr('disabled');
				/* $(_this).siblings('select.choceMajor').html(majorstr)
				var list=[];
				choceschool.each(function () {
				    var i=$(this).val()
				    if(i != ""){
				        list.push(i);
				    }
				}) */
				/* 
				 //点击学校不重复
				 var optionlist='<option value="">--选择学校--</option>';
				 for(var f=0,k=data.length;f<k;f++){
				 var id=data[f].id.toString();
				 if(list.indexOf(id)=="-1"){
				 optionlist +='<option value="'+data[f].id+'">'+data[f].name+'</option>'
				 }

				 }
				 if(thisId == ""){
				 $(_this).addClass('csd')
				 }else {
				 $(_this).removeClass('csd')
				 }
				 $(".choceSchool.csd").html(optionlist) 
				 */
			}
		})

	});
</script>

</html>